Using Windows 2008 PowerShell

Although most every user knows about Windows PowerShell, many do not know or fully appreciate how much power it actually brings to the management of a Windows Server 2008 system. PowerShell features a vast array of commands and syntax that can make everyday chores a lot easier. What's more, PowerShell proves to be an excellent aid for solving technical problems, quickly and easily. With that in mind, it becomes obvious why a user would want to master PowerShell, especially the commands that can help to solve problems quickly. Here are a few examples of commands that can be executed via PowerShell:

 Get-WmiObject -Class Win32_ComputerSystem
   Determine the make and model of a computer
 Get-WmiObject -Class Win32_BIOS ComputerName
   Discover information about the BIOS
 Get-WmiObject -Class Win32_ComputerSystem -Property UserName ComputerName
   Determine the username of who is logged on
 Get-WmiObject -Class Win32_NetworkAdapterConfiguration -Filter
 IPEnabled=TRUE -ComputerName . | Format-Table -Property IPAddress
   Get IP addresses assigned to the current computer
 (Get-WMIObject -ComputerName TARGETMACHINE -List | Where-Object
 -FilterScript {$_.Name -eq
 "Win32_Product"}).Install(\MACHINEWHEREMSIRESIDESpathpackage.msi)
   Install an MSI package on a remote computer
 (Get-WmiObject -Class Win32_Product -Filter "Name='product_to_remove'"
 -ComputerName . ).Uninstall()
   Remove an MSI package from the current computer
 Start-Sleep 60; Restart-Computer Force ComputerName TARGETMACHINE
   Remotely shut down another machine after one minute
 enter-pssession TARGETMACHINE
   Enter into a remote PowerShell session (you must have remote
   management enabled)
 (Get-WmiObject -Class Win32_Product -ComputerName . Filter
 "Name='name_of_app'").
 Upgrade(\MACHINEWHEREMSIRESIDESpathupgrade_package.msi)
   Upgrade an installed application with an MSI-based application
   upgrade package
 Get-WmiObject -Class Win32_NetworkAdapterConfiguration -Filter
 IPEnabled=TRUE -ComputerName . | Select-Object -Property [a-z]*
 -ExcludeProperty IPX*,WINS*
   Get a more detailed IP configuration report for the current machine

Of course, the above is only a sampling of what can be done with PowerShell. However, it is those commands that illustrate how powerful PowerShell can be for managing both Local and Remote servers. What's more, many of the commands can be run on remote client PCs as well, further easing administration and troubleshooting.